Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

teeny-request

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

teeny-request

Like request, but smaller.

  • 6.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.9M
decreased by-42.65%
Maintainers
4
Weekly downloads
 
Created

What is teeny-request?

The teeny-request npm package is a lightweight HTTP client designed to be a minimalistic wrapper around the native http and https modules in Node.js. It is used to make HTTP requests from Node.js applications with a simple and easy-to-use API.

What are teeny-request's main functionalities?

Simple HTTP GET requests

This feature allows you to perform a simple HTTP GET request to retrieve data from a specified URL.

const teenyRequest = require('teeny-request');
teenyRequest('http://example.com', (error, response, body) => {
  if (!error && response.statusCode == 200) {
    console.log(body);
  }
});

HTTP POST requests with JSON body

This feature allows you to perform an HTTP POST request with a JSON body to send data to a server.

const teenyRequest = require('teeny-request');
teenyRequest({
  method: 'POST',
  uri: 'http://example.com/api/data',
  body: { key: 'value' },
  json: true
}, (error, response, body) => {
  if (!error && response.statusCode == 200) {
    console.log(body);
  }
});

Custom headers and other options

This feature allows you to customize the headers and other options for your HTTP request.

const teenyRequest = require('teeny-request');
teenyRequest({
  method: 'GET',
  uri: 'http://example.com',
  headers: {
    'User-Agent': 'My-Custom-User-Agent'
  }
}, (error, response, body) => {
  if (!error && response.statusCode == 200) {
    console.log(body);
  }
});

Other packages similar to teeny-request

Keywords

FAQs

Package last updated on 10 Mar 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc